﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Input;

namespace TBG.TBG_F
{

    //Skill is in seperate class since I want each skill add seperatly and need to know its position
    class Skill
    {
        public Texture2D _Skill { get; set; }
        public Vector2 _Location { get; set; }

        public Skill(ContentManager content)
        {
            _Skill = content.Load<Texture2D>("skilltest");
        }

        public Skill(ContentManager content, Vector2 _Location)
        {
            //_Skill = content.Load<Texture2D>("skilltest");
            this._Location = _Location;
        }
    }

    /*
    #region Approach ONE
    class Interface
    {
    Texture2D _SkillBar;
    Vector2 _SkillBarLocation;    
    List<Skill> _Skills = new List<Skill>();

    public Interface(ContentManager content)
    {
        //Skill bar initialization
        _SkillBar = content.Load<Texture2D>("skillbar");
        _SkillBarLocation = new Vector2(5, 5);

        //Skills initialization hard coded
        Skill skill0 = new Skill(content, new Vector2(_SkillBarLocation.X + 2, _SkillBarLocation.Y + 2));
        Skill skill1 = new Skill(content, new Vector2(_SkillBarLocation.X + 54, _SkillBarLocation.Y + 2));
        Skill skill2 = new Skill(content, new Vector2(_SkillBarLocation.X + 106, _SkillBarLocation.Y + 2));
        Skill skill3 = new Skill(content, new Vector2(_SkillBarLocation.X + 158, _SkillBarLocation.Y + 2));
        Skill skill4 = new Skill(content, new Vector2(_SkillBarLocation.X + 210, _SkillBarLocation.Y + 2));

        _Skills.Add(skill0);
        _Skills.Add(skill1);
        _Skills.Add(skill2);
        _Skills.Add(skill3);
        _Skills.Add(skill4);
    }

    public void Draw(SpriteBatch spriteBatch)
    {
        spriteBatch.Draw(_SkillBar, _SkillBarLocation, Color.White);

        foreach (Skill skill in _Skills)
        {
            spriteBatch.Draw(skill._Skill, skill._Location, Color.White);
        }
    } 
}
#endregion
*/

    #region Approach TWO
    class Interface
    {
        Texture2D _Interface;
        Vector2 _InterfaceLocation;
        Vector2 _SkillBarLocation;
        List<Skill> _Skills = new List<Skill>();

        public Interface(ContentManager content)
        {
            //Skill bar initialization
            _Interface = content.Load<Texture2D>("interface");
            _InterfaceLocation = Vector2.Zero;
            _SkillBarLocation = new Vector2(715, 431);

            //Skills initialization hard coded
            //Skill skill0 = new Skill(content, new Vector2(_SkillBarLocation.X + 2, _SkillBarLocation.Y + 2));
            //Skill skill1 = new Skill(content, new Vector2(_SkillBarLocation.X + 54, _SkillBarLocation.Y + 2));
            //Skill skill2 = new Skill(content, new Vector2(_SkillBarLocation.X + 106, _SkillBarLocation.Y + 2));
            //Skill skill3 = new Skill(content, new Vector2(_SkillBarLocation.X + 158, _SkillBarLocation.Y + 2));
            //Skill skill4 = new Skill(content, new Vector2(_SkillBarLocation.X + 210, _SkillBarLocation.Y + 2));

            //_Skills.Add(skill0);
            //_Skills.Add(skill1);
            //_Skills.Add(skill2);
            //_Skills.Add(skill3);
            //_Skills.Add(skill4);
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(_Interface, _InterfaceLocation, Color.White);

            foreach (Skill skill in _Skills)
            {
                //spriteBatch.Draw(skill._Skill, skill._Location, Color.White);
            }
        } 
    }
    #endregion
}
